import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { User } from '../types'
export const useUserStore = defineStore('user', () => {
	const accessToken = ref<string>('')
	const refleshToken = ref<string>('')
	const userInfo = ref(<User | null>({
	})
	)
	const clearStore = () => {
		accessToken.value = ''
		refleshToken.value = ''
		userInfo.value = null
	}
	return {
		accessToken,
		refleshToken,
		userInfo,
		clearStore
	}
}, { persist: true })
